Repository navigation
fix: retry Gemini timeouts and transient server errors in visual tests - #40
Merged
Merged
Conversation
Request timeouts escaped executeWithRetry and only 429/503 were retried, so a slow or busy Gemini failed visual tests on any PR. Retry timeouts, network errors, 429 and 5xx with exponential backoff, and raise the request timeout to 120 seconds.
Coverage (unit tests)No unit baseline recorded in
Line and branch coverage from unit test reports. History is recorded in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VisualMapSampleTest.verifyStoreLocatorMapRenderingfails whenever Gemini is slow or busy, on any PR and onmain. On Dec 2 the instrumentation job failed four times in a row: once with503 UNAVAILABLE("This model is currently experiencing high demand") and three times withHttpRequestTimeoutExceptionafter 60 seconds. Aworkflow_dispatchrun onmainat the same time as one on #39 failed the same way, so the cause is Gemini latency, not the code under test.Root cause
GeminiVisualTestHelper.executeWithRetryonly retried429and503, with a short linear backoff, and never retried a timeout. A request timeout escaped fromclient.postand failed the test on the first slow response.Changes
IOExceptions,429, and any5xx. Other statuses such as400still fail immediately.GeminiRetryTestcovering timeout,5xxand429retries, giving up after the last attempt, and no retry on400.No public API change (
apiCheckpasses).Verification
./gradlew spotlessCheck :visual-testing:testDebugUnitTest :visual-testing:apiCheck :visual-testing:lintDebug --rerun-tasks --no-build-cachepasses (36 tests, 7 new).